<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="${staticServer}/inc/style/main.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/page.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/date/datepicker.css" />
<link rel="stylesheet" href="${staticServer}/css/work_today.css" />
<script src="${staticServer}/inc/js/jquery.js"></script>
<script src="${staticServer}/inc/js/pageset.js"></script>
<script src="${staticServer}/inc/js/infopad.js?2.2"></script>
<script src="${staticServer}/inc/js/datepicker.js"></script>
<script>
//var infopad = parent.infopad;


$(function(){
	$("#sources").val("${source}");
});

function starquery(type)
{
	var url = "";
	var param_str = "";
	if(type==0)
	{
		var address = $("#address").val();
		var phone = $("#phone").val();
		var weixin = $("#weixin").val();

		var email = $("#email").val();
		var qq = $("#qq").val();
		var sdate = $("#start_date").val();
		var edate = $("#end_date").val();
		var sdate1 = $("#start_date1").val();
		var edate1 = $("#end_date1").val();
		var region = $("#region").val();
		var state = $("#state").val();
		var nickname = $("#nickname").val();
		var receptioner = $("#receptioner").val();
		var source = $("#sources").val();
		var update_user = $("#update_users").val();
		
		if(sdate>edate){
			alert("选择日期出错。请重新选择！");
			$("#start_date").val(" ");
			$("#end_date").val(" ");
			return;
		}
		if(sdate1>edate1){
			alert("选择日期出错。请重新选择！");
			$("#start_date1").val(" ");
			$("#end_date1").val(" ");
			return;
		}
		
		var is_signer = $("#is_signer").prop("checked")?1:0;
		var is_receptioner = $("#is_receptioner").prop("checked")?1:0;
		var params = [];

		if(!empty(nickname)) params.push("nickname=" + nickname);
		if(!empty(receptioner)) params.push("receptioner=" + receptioner);
		if(!empty(address)) params.push("address=" + address);
		if(!empty(phone)) params.push("phone=" + phone);
		if(!empty(email)) params.push("email=" + email);
		if(!empty(qq)) params.push("qq=" + qq);
		if(!empty(sdate)) params.push("sdate=" + sdate);
		if(!empty(edate)) params.push("edate=" + edate);
		if(!empty(sdate1)) params.push("sdate1=" + sdate1);
		if(!empty(edate1)) params.push("edate1=" + edate1);
		if(!empty(region)) params.push("region=" + region);
		if(!empty(source)) params.push("source=" + source);
		if(!empty(update_user)) params.push("update_user=" + update_user);
		if(!empty(weixin)) params.push("weixin=" + weixin);

		
		if(!empty(state)) params.push("state=" + state);
		params.push("is_signer=" + is_signer);
		params.push("is_receptioner=" + is_receptioner);
		
		url = "?" + params.join("&");
	}
	else
	{
		url = "?";
	}
	
	location.href = "${contextPath}/index/consultant_client_reserve_list.htm"+url;
	
}


//输入框回车事件
function EnterPress(e){
var e = e || window.event; 
if(e.keyCode == 13){ 
		var total = $("#total").val();
		var page = $("#pages").val();
		var address = $("#address").val();
		var phone = $("#phone").val();
		var email = $("#email").val();
		var qq = $("#qq").val();
		var sdate = $("#start_date").val();
		var edate = $("#end_date").val();
		var region = $("#region").val();
		var state = $("#state").val();
		var nickname = $("#nickname").val();
		var receptioner = $("#receptioner").val();
		var is_signer = $("#is_signer").prop("checked")?1:0;
		var is_receptioner = $("#is_receptioner").prop("checked")?1:0;
		var source = $("#sources").val();
		var update_user = $("#update_users").val();
		
		var nextpage = parseInt(page);
		var total1 = parseInt(total);
		
	if((nextpage > total1)){
		alert("输入的页数要小于总页数。");
	}else{
		location.href=encodeURI("${contextPath}/index/consultant_client_reserve_list.htm?currPage="+page+"&nickname="+nickname+"&receptioner="+receptioner+"&address="+address+"&phone="+phone+"&email="+email+"&qq="+qq+"&sdate="+sdate+"&edate="+edate+"&region="+region+"&state="+state+"&is_signer="+is_signer+"&is_receptioner="+is_receptioner+"&source="+source+"&update_user="+update_user);
		}
	} 
}

</script>
</head>

<body>
	<div id="home_link">
		<ul>
			<li></li>
			<li>&gt;</li>
			<li>咨询师业务管理</li>
			<li>&gt;</li>
			<li class="current">预约数据查询</li>
		</ul>
	</div>
	<div id="container">
		<div id="title"></div>
		<table class="simple_table" rel="nohover" style="min-width: 750px;">
			<tr>
				<td><label for="client">客户名字：</label>
					<input type="text" id="nickname" size="15" placeholder="客户名字" value="${nickname}" /> 
				<label for="user">接待老师：</label>
					<input type="text" id="receptioner" value="${receptioner}" size="15" placeholder="接待老师名字" />
				<label for="address">地区：</label>
					<input type="text" id="address"size="28" placeholder="省、市、地址" value="${address}" /></td>
				</td>
				<td rowspan="4"><input type="button" value=" 查 询 " onclick="starquery(0)" />
				<input type="button" value=" 重 置 " onclick="starquery(1)" /></td>
			</tr>
			<tr>
				<td><label for="phone">联系电话：</label>
				<input type="text" id="phone" size="15" placeholder="客户联系电话" value="${phone}" /> 
				<label for="phone">微信：</label>
				<input type="text" id="weixin" size="15" placeholder="客户微信"  /> 
				<label for="qq">ＱＱ号码：</label>
				<input type="text" id="qq" size="15" placeholder="QQ号码" value="${qq}" />
				<label for="email">邮箱：</label><input type="text" id="email" size="28" placeholder="Email地址" value="${email}" />
				</td>
			</tr>  
			<tr>
				<td><label for="region">预约中心：</label>
				<select id="region" style="width:142px;">
                	<option value="">-- 请选择目标 --</option>
                	<#if offlist??>
						<#list offlist as list>
                			<option value="${list.keyname}" title="${list.address}" <#if region == list.keyname>selected</#if> >${list.name}</option>
                		</#list>
                	</#if>
                	</select><label for="region">预约状态：</label>
                	
                	<select id="state">
                	<option value="">-- 请选择目标 --</option>
                		<option value="1" <#if state == 1 >selected</#if> title="客户需在预约时间内进一步确认">待确认</option>
                		<option value="2" <#if state == 2 >selected</#if> title="客户已上门进行测评">已出现</option>
                		<option value="3" <#if state == 3 >selected</#if> title="客户未出现，预约已过期">未出现</option>
                	</select>
                	
                	<label for="source">来源渠道：</label>
                	<select id="sources"><option value="">-- 请选择 --</option>
                	<option value='cru0943rdrf2' title='用于标记无效资源'>未知</option><option value='nupd5182xxsl' title=''>网站问卷</option><option value='l6xdybjjrcjc' title=''>手机问卷</option><option value='czhi7pjiadhu' title=''>19楼问卷</option><option value='l6e69n6t0xdf' title=''>微博问卷</option><option value='osjrem0am5af' title=''>微博粉丝通问卷</option><option value='eyxl17rri7xu' title=''>搜狗搜索</option><option value='jd2q59wq41ed' title='来源于百度搜索的竞价收费资源'>百度搜索</option><option value='251mokab1mtn' title=''>百度网盟</option><option value='l0j9fitg3t94' title='来源于百度搜索的免费资源'>百度自然搜索</option><option value='cwo3dhreyo3g' title=''>百度知道</option><option value='hcat5zqt7jta' title=''>百度教育</option><option value='zgviq7wj9j0p' title=''>360搜索</option><option value='pmvk5vdc6ity' title='请填写具体网址'>商桥其它</option><option value='3p5idbdw49di' title=''>公益讲座</option><option value='nmeq3ambzitw' title=''>培训通</option><option value='k4jmt5lbp8ne' title=''>400电话</option><option value='09ceooqhs782' title=''>广告推广</option><option value='dz6favkfbcpb' title='直接或间接因素上门咨询'>上门咨询</option><option value='ka3e06t6qqni' title=''>本地电话</option><option value='wxc7hq1lln1y' title=''>家长转介绍</option><option value='iwpby6xld7x1' title=''>淘宝旺旺</option><option value='txrf7rjlaq0n' title=''>返学费网</option><option value='3uz0gyx626dp' title=''>搜学校网</option><option value='0n2njx5zmzvo' title=''>网站留言</option><option value='ct5yq4jhc6c7' title=''>市场部推广</option><option value='oaw3mfz6l521' title=''>哈哈儿童网</option><option value='oymhrrozjjqq' title=''>直接访问</option><option value='lyx063wpay9l' title=''>百度推广</option><option value='ro9iszkillrp' title=''>微信问卷</option><option value='c0lnj8or2mrr' title=''>报纸广告</option><option value='5a2l1xsq7dcp' title=''>已测试</option><option value='pcalex0wpcy3' title=''>网站手机抓取</option><option value='k3i6bvxdlm2d' title=''>QQ老资料</option><option value='895q48oh4jpp' title=''>百度贴吧</option><option value='gx50j0s9hrr1' title=''>传单派发</option><option value='edhhjon7t6za' title=''>商桥留言</option><option value='13b6lzltt0xk' title=''>网站报名</option><option value='v04u5uv2490h' title=''>新浪扶翼</option><option value='8yjy5cw5w5x0' title=''>网络部推广</option><option value='fu9d8zgsndne' title=''>内部推荐</option><option value='3qttf7j4ydu3' title=''>东书房合作</option><option value='ewk5wys8ylqa' title=''>电销部门</option><option value='cwfxxia9nn3l' title=''>上海外呼诺访</option><option value='96tcllg3xk21' title=''>58同城</option><option value='cxn6ozuszles' title=''>赶集网</option><option value='wtukdq8gp65h' title=''>市场部问卷</option><option value='frvmppoifgmb' title=''>今日头条广告</option><option value='kip4mcx4i9bf' title=''>远播网</option><option value='udfjjispr43w' title=''>淘宝咨询</option><option value='kzpctoxsbclx' title=''>百度推课</option><option value='dbmtj1jhld70' title=''>淘宝推广</option><option value='kk51qfgzk1rq' title=''>教育联展网</option><option value='8vhblyaircwt' title=''>教育宝</option></select> 
                	
                	<label for="update_user">多个预约人：</label>
                	<select id="update_users"><option value="">-- 请选择 --</option>
                	<option value='' title=''>一个</option><option value='2' title=''>多个</option></select> 
				
				</td>
			</tr>
			<tr>
				<td>
					<label for="start_date">预约起始日期：</label>
					<input type="text" name="start_date" id="start_date" size="15"value="${sdate}" rel="DATE::Y-m-d" /> 
					<label for="end_date">预约终止日期：</label>
					<input type="text"name="end_date" id="end_date" size="15" value="${edate}" rel="DATE::Y-m-d" />
					<label for="start_date1">登记起始日期：</label>
					<input type="text" name="start_date1" id="start_date1" size="15"value="${sdate1}" rel="DATE::Y-m-d" /> 
					<label for="end_date1">登记终止日期：</label>
					<input type="text"name="end_date1" id="end_date1" size="15" value="${edate1}" rel="DATE::Y-m-d" />
					<label for="is_signer" title="显示所有自己发布的预约">
						<input type="checkbox" <#if is_signer == "1">checked<#else> </#if> id="is_signer">自己发布</label> 
					<label for="is_receptioner" title="显示所有自己作为接待人的预约（包含他人发布的预约）">
						<input type="checkbox" <#if is_receptioner == "1">checked<#else> </#if>  id="is_receptioner">自己接待</label>
				</td>
			</tr>
			
			
		</table>
		<table>
			<tr class="fields">
				<th>预约日期</th>
				<th>客户姓名</th>
				<th>预约中心</th>
				<th>所在地</th>
				<th>预约人</th>
				<th>接待人</th>
				<th>类型</th>
				<th>客户状态</th>
				<th>登记日期</th>
				<th>操作</th>
			</tr>
			
			<#if list??>
			<#list list as list>
			<tr class="even_row" id="${list.keyname}" name="${list.keyname}">
				<td align="center"><span class="quote">
					${list.date?date} ${list.time}</span>
					<#if list.update_UserTimes><#list list.update_UserTimes as strUserTime>
						<div><span class="quote">${strUserTime}</span></div>
					</#list></#if>
				</td>
				<td align="center" class="stress" width="100">${list.nickname}<em class="valid"><br/><#if list.invalid=="0">（有效）<#else>（无效）</#if></em></td>
				<td align="center">${list.regionns}</td>
				<td align="center">${list.province} - ${list.city}</td>
				<td align="center">
					<span class="quote">${list.signer}</span>
					<#if list.update_Users><#list list.update_Users as strUser>
						<#if user??><div><a href="javascript:;" onclick="chooseNewYyTea('${list.signer}','${strUser}','${list.id}','${strUser_index}')" style="font-size: 13pt;" title="确定选取这个老师为最终预约人吗?"><label for="client">${strUser}</label></a></div>
						<#else><div><label for="client">${strUser}</label></div></#if>
					</#list></#if>
				</td>
				<td align="center">${list.receptioner}</td>
				<td align="center" name="${list.state}"><#if list.non=="0">测评<#else>非测评</#if></td>
				<td align="center" width="100"><span class="confirmed unit hand"><#if list.state == 1>待确定<#elseif list.state == 2>已出现<#elseif list.state == 3 >未出现</#if></span></td>
				<td align="center">${list.startTime}</td>
				<td align="center"><a href="${contextPath}/index/system_reserve_view.htm?keyname=${list.keyname}">详细信息</a></td>
			</tr>
			</#list>
			</#if>
			
		</table>
	</div>
	<script type="text/javascript">
		function chooseNewYyTea(oldUserName,userName,id,strUser_index){
			var flag = window.confirm("确定选取 “"+userName+"” 这个老师为最终预约人吗?");
			if(flag==true){
				$.ajax({
		             type: "get",
		             url: "setNewYuyueRen.json",
		             data: {id:id, userName:userName,index:strUser_index,oldUserName:oldUserName},
		             dataType: "json",
		             success: function(data){
		            	 if(data=true){
		            		alert("已设置该老师为最终预约人！");
		            		location.href=encodeURI("${contextPath}/index/consultant_client_reserve_list.htm?currPage=${page.currpage}&nickname=${nickname}&receptioner=${receptioner}&address=${address}&phone=${phone}&email=${email}&qq=${qq}&sdate=${sdate}&edate=${edate}&sdate1=${sdate1}&edate1=${edate1}&region=${region}&state=${state}&is_signer=${is_signer}&is_receptioner=${is_receptioner}&source=${source}&update_user=${update_user}");
		            	 }else
		    			　　   alert("设置失败！");
		             }
		         });
			}else
			　　   alert("您取消了哦！");
		}
	
	</script>
	<div id="pager" style="width: 820px;">
	<ul id="pagination">
		<#if page??>
		<#if page.pagetotal?? && page.pagetotal!="0">
	<#assign pagetotal = page.pagetotal>
	<#else>
	<#assign pagetotal = 1>
	</#if>
			<#if page.currpage??>
	<#assign currpage = page.currpage>
	<#else>
	<#assign currpage = 1>
	</#if>
		<input type="hidden" id="total" value="${page.pagetotal}">
				<#if currpage==1 >
					<li class="previous-off">首页</li>
					<li class="previous-off">上一页</li>
					<#else>
					<li class="previous"><a href="${contextPath}/index/consultant_client_reserve_list.htm?currPage=1&nickname=${nickname}&receptioner=${receptioner}&address=${address}&phone=${phone}&email=${email}&qq=${qq}&sdate=${sdate}&edate=${edate}&sdate1=${sdate1}&edate1=${edate1}&region=${region}&state=${state}&is_signer=${is_signer}&is_receptioner=${is_receptioner}&source=${source}&update_user=${update_user}">首页</a></li>
					<li class="previous"><a href="${contextPath}/index/consultant_client_reserve_list.htm?currPage=${currpage-1}&nickname=${nickname}&receptioner=${receptioner}&address=${address}&phone=${phone}&email=${email}&qq=${qq}&sdate=${sdate}&edate=${edate}&sdate1=${sdate1}&edate1=${edate1}&region=${region}&state=${state}&is_signer=${is_signer}&is_receptioner=${is_receptioner}&source=${source}&update_user=${update_user}">上一页</a></li>
					</#if>
					
		<#if pagetotal<=11>
			<#list 1..pagetotal as index_up>  
	           <#if currpage==index_up > 
	           		<li class="current">${index_up}</li>
	           <#else>
	           		<li><a href="${contextPath}/index/consultant_client_reserve_list.htm?currPage=${index_up}&nickname=${nickname}&receptioner=${receptioner}&address=${address}&phone=${phone}&email=${email}&qq=${qq}&sdate=${sdate}&edate=${edate}&sdate1=${sdate1}&edate1=${edate1}&region=${region}&state=${state}&is_signer=${is_signer}&is_receptioner=${is_receptioner}&source=${source}&update_user=${update_user}">${index_up}</a></li>  
	           </#if>  
			</#list>  
		<#else>
			<#if currpage<=8 >
				<#list 1..9 as index_up>  
	           	<#if currpage==index_up >  
	            	<li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/index/consultant_client_reserve_list.htm?currPage=${index_up}&nickname=${nickname}&receptioner=${receptioner}&address=${address}&phone=${phone}&email=${email}&qq=${qq}&sdate=${sdate}&edate=${edate}&sdate1=${sdate1}&edate1=${edate1}&region=${region}&state=${state}&is_signer=${is_signer}&is_receptioner=${is_receptioner}&source=${source}&update_user=${update_user}">${index_up}</a></li> 
	           	</#if>
	           	</#list>  
	           	<li>...</li>
	           	<li><a href="${contextPath}/index/consultant_client_reserve_list.htm?currPage=${pagetotal}&nickname=${nickname}&receptioner=${receptioner}&address=${address}&phone=${phone}&email=${email}&qq=${qq}&sdate=${sdate}&edate=${edate}&sdate1=${sdate1}&edate1=${edate1}&region=${region}&state=${state}&is_signer=${is_signer}&is_receptioner=${is_receptioner}&source=${source}&update_user=${update_user}">${pagetotal}</a></li>  
				
			<#elseif (currpage>= 9 && currpage<pagetotal-7)  >	
				<li><a href="${contextPath}/index/consultant_client_reserve_list.htm?currPage=1&nickname=${nickname}&receptioner=${receptioner}&address=${address}&phone=${phone}&email=${email}&qq=${qq}&sdate=${sdate}&edate=${edate}&sdate1=${sdate1}&edate1=${edate1}&region=${region}&state=${state}&is_signer=${is_signer}&is_receptioner=${is_receptioner}&source=${source}&update_user=${update_user}">1</a></li>  
				<li>...</li>
				<#list currpage-3..currpage+3 as index_up>  
	           	<#if currpage==index_up >  
	             <li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/index/consultant_client_reserve_list.htm?currPage=${index_up}&nickname=${nickname}&receptioner=${receptioner}&address=${address}&phone=${phone}&email=${email}&qq=${qq}&sdate=${sdate}&edate=${edate}&sdate1=${sdate1}&edate1=${edate1}&region=${region}&state=${state}&is_signer=${is_signer}&is_receptioner=${is_receptioner}&source=${source}&update_user=${update_user}">${index_up}</a></li>  
	           	</#if>
	           	</#list>
				<li>...</li>
	           	<li><a href="${contextPath}/index/consultant_client_reserve_list.htm?currPage=${pagetotal}&nickname=${nickname}&receptioner=${receptioner}&address=${address}&phone=${phone}&email=${email}&qq=${qq}&sdate=${sdate}&edate=${edate}&sdate1=${sdate1}&edate1=${edate1}&region=${region}&state=${state}&is_signer=${is_signer}&is_receptioner=${is_receptioner}&source=${source}&update_user=${update_user}">${pagetotal}</a></li>   
			<#else>
				<li><a href="${contextPath}/index/consultant_client_reserve_list.htm?currPage=1&nickname=${nickname}&receptioner=${receptioner}&address=${address}&phone=${phone}&email=${email}&qq=${qq}&sdate=${sdate}&edate=${edate}&sdate1=${sdate1}&edate1=${edate1}&region=${region}&state=${state}&is_signer=${is_signer}&is_receptioner=${is_receptioner}&source=${source}&update_user=${update_user}">1</a></li> 
				<li>...</li>
				<#list pagetotal-8..pagetotal as index_up>  
	           	<#if currpage==index_up >  
	             <li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/index/consultant_client_reserve_list.htm?currPage=${index_up}&nickname=${nickname}&receptioner=${receptioner}&address=${address}&phone=${phone}&email=${email}&qq=${qq}&sdate=${sdate}&edate=${edate}&sdate1=${sdate1}&edate1=${edate1}&region=${region}&state=${state}&is_signer=${is_signer}&is_receptioner=${is_receptioner}&source=${source}&update_user=${update_user}">${index_up}</a></li> 
	           	</#if>
				</#list>  
			</#if>
			
		</#if> 
		<#if currpage==pagetotal >
		 	<li class="previous-off">下一页</li>
		 <li class="previous-off">尾页</li>
		<#else>
			<li class="previous"><a href="${contextPath}/index/consultant_client_reserve_list.htm?currPage=${currpage+1}&nickname=${nickname}&receptioner=${receptioner}&address=${address}&phone=${phone}&email=${email}&qq=${qq}&sdate=${sdate}&edate=${edate}&sdate1=${sdate1}&edate1=${edate1}&region=${region}&state=${state}&is_signer=${is_signer}&is_receptioner=${is_receptioner}&source=${source}&update_user=${update_user}">下一页</a></li>
			<li class="previous"><a href="${contextPath}/index/consultant_client_reserve_list.htm?currPage=${page.pagetotal}&nickname=${nickname}&receptioner=${receptioner}&address=${address}&phone=${phone}&email=${email}&qq=${qq}&sdate=${sdate}&edate=${edate}&sdate1=${sdate1}&edate1=${edate1}&region=${region}&state=${state}&is_signer=${is_signer}&is_receptioner=${is_receptioner}&source=${source}&update_user=${update_user}">尾页</a></li>
		</#if>
		<li class="previous"><input type="text" id="pages" onkeypress="EnterPress(event)" size="10" placeholder="跳转页数" style="line-height: 30px; padding: 0 11px 0 11px;"></li>
		<li class="pageinfo">共${page.total}条记录</li>
	</#if>
	</ul></div>
	<div class="emptyline"></div>
</body>
</html>